/***************************************************************
****************************************************************
****************** Parser for Interpreted LPMED ****************
****************************************************************
***************************************************************/

parser grammar iLPMED;

options
{
	tokenVocab = LPMEDLexer;
	output = AST;
	ASTLabelType=CommonTree;
	language = CSharp2;
}

import LPMEDParser;

@namespace { Core.ANTLRGrammars }

@members
{
	public System.Collections.Generic.List<Exception> Logger = new System.Collections.Generic.List<Exception>();
}

//#################################### Constructions declarations ###################################################


//######################################## Main Rule ################################################################
//Interpretation block consists of zero or more statements
program
: 
	(stmts += stmt | decls += varDecListFree)* -> ^(CPROGRAM $decls* ^(CSTATEMENT $stmts*))
;
catch [Exception e] {Logger.Add(e); if (e is RecognitionException) Recover(input,(RecognitionException)e);}
